| 1 | |
| 2 | [[PageOutline(3-4, Sections)]] |
| 3 | |
| 4 | == !SearchToMail == |
| 5 | |
| 6 | === Intro === |
| 7 | |
| 8 | schedule a periodical search for subtitles matching given video files, send results to user's e-mail address. |
| 9 | |
| 10 | |
| 11 | ---- |
| 12 | === Description === |
| 13 | |
| 14 | '''struct !SearchToMail(string $token, array(string $sublanguageid, string $sublanguageid, ...) $sublangs, array(struct('moviehash' => string $moviehash, 'moviesize' => double $moviesize), ...) $videos)''' |
| 15 | |
| 16 | This function will perodically search for subtitles in languages ''sublangs'' and matching video files ''videos'' and send the results to user's e-mail address. |
| 17 | |
| 18 | Available only to registered users. |
| 19 | |
| 20 | Scenario: user has a directory with movies he cannot find subtitles to. With this function he can subscribe to possible results, when someone else uploads matching subtitles. |
| 21 | |
| 22 | Once a day/week (based on user's profile) the system will send subtitle link by e-mail to user's e-mail address. |
| 23 | |
| 24 | {{{ |
| 25 | #!html |
| 26 | <div style='color:red'>This page contains unverified information, if you try to implement this feature and find any mistakes, please, fix them.</div> |
| 27 | }}} |
| 28 | |
| 29 | |
| 30 | ---- |
| 31 | === Parameters === |
| 32 | |
| 33 | Used parameter structure: |
| 34 | {{{ |
| 35 | struct( |
| 36 | (string) [token], |
| 37 | array( <--- list of subtitle languages |
| 38 | (string) [lang3], |
| 39 | (string) [lang3], |
| 40 | ... more subtitle language IDs go here (if any) ... |
| 41 | ), |
| 42 | array( <--- list of video files |
| 43 | struct( <--- video file information |
| 44 | (string) [moviehash], |
| 45 | (double) [moviesize] |
| 46 | ), |
| 47 | ... more video file information structures go here (if any) ... |
| 48 | ) |
| 49 | ) |
| 50 | }}} |
| 51 | |
| 52 | This function takes 3 parameters, first is the session token, second is an array of subtitle languages and third is the array/list of video file hashes. |
| 53 | |
| 54 | ''token (required)'':: |
| 55 | token string identifying user's session, taken from [XmlRpcLogIn LogIn] output structure. |
| 56 | token mustn't be a session of an anonymous user |
| 57 | ''sublangs'':: |
| 58 | array of subtitle file language IDs (ISO639-3 codes), |
| 59 | if no languages are specified (array is empty), system will try to find subtitles in all languages. |
| 60 | ''videos'':: |
| 61 | array of video file information using structure displayed below. |
| 62 | |
| 63 | Structure of video file information: |
| 64 | {{{ |
| 65 | struct( |
| 66 | (string) [moviehash], |
| 67 | (double) [moviesize] |
| 68 | ) |
| 69 | }}} |
| 70 | |
| 71 | |
| 72 | ---- |
| 73 | === Return Values === |
| 74 | |
| 75 | The returned structure contains these elements: |
| 76 | ''status'':: |
| 77 | function result code, see [XmlRpcStatusCode list of status codes] |
| 78 | ''seconds'':: |
| 79 | time taken to execute this command on server |
| 80 | |
| 81 | |
| 82 | ---- |
| 83 | === Implementations === |
| 84 | |
| 85 | There are currently no available sample implementations. |
| 86 | |
| 87 | |
| 88 | ---- |
| 89 | === Changelog === |
| 90 | |
| 91 | Version 1: created this function |
| 92 | |
| 93 | |
| 94 | ---- |
| 95 | === Examples === |
| 96 | |
| 97 | |
| 98 | ==== Input ==== |
| 99 | |
| 100 | {{{ |
| 101 | #!html |
| 102 | <div style='color:red'>TO-DO</div> |
| 103 | }}} |
| 104 | |
| 105 | |
| 106 | ==== Output ==== |
| 107 | |
| 108 | {{{ |
| 109 | #!xml |
| 110 | <methodResponse> |
| 111 | <params> |
| 112 | <param> |
| 113 | <value> |
| 114 | <struct> |
| 115 | <member> |
| 116 | <name>status</name> |
| 117 | <value><string>200 OK</string></value> |
| 118 | </member> |
| 119 | <member> |
| 120 | <name>seconds</name> |
| 121 | <value><double>0.197</double></value> |
| 122 | </member> |
| 123 | </struct> |
| 124 | </value> |
| 125 | </param> |
| 126 | </params> |
| 127 | </methodResponse> |
| 128 | }}} |
| 129 | |
| 130 | |
| 131 | ---- |
| 132 | === Notes === |
| 133 | |
| 134 | * if possible, send moviehashes and moviesizes only for the first CD in set (e.g. for movies on 2+ CDs) because users will receive duplicate e-mails (one for CD1, one for CD2, ...) |
| 135 | |
| 136 | |
| 137 | ---- |
| 138 | === See also === |
| 139 | |
| 140 | * [wiki:XmlRpcSearchSubtitles SearchSubtitles] |
| 141 | |
| 142 | |
| 143 | ---- |
| 144 | === Comments === |
| 145 | |
| 146 | add your comments, hints and suggestions here if you like ... |
| 147 | |
| 148 | |
| 149 | -------- |
| 150 | [Prev] [wiki:XmlRpcIntro Home] [Next] |